<?
	require_once('../inc/Accounts.php');
	require_once('../inc/Users.php');
	RequireLogin();
?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Database Access</title>
        <link type="text/css" rel="stylesheet" href="../inc/bootstrap.css" />
		<link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
		<style type="text/css" >
            .error { color: red; }
            input.error { border-color: red; }
        </style>
    </head>
    
    <body>
    	
        <? include('../inc/header.php'); ?>
        <div class="container">
			<? include('../inc/nav.php'); ?>
            <div id="contents">
            
                <form method="post" action="edit.php">
                <table class="table table-striped table-bordered table-condensed table-hover">
                </table>
                </form>
            </div>
        </div>
        
            <div class="modal hide fade">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h3>Delete</h3>
                </div>
                <div class="modal-body">
                    <p>Are you sure etc.</p>
                </div>
            </div>
        
       <script type="application/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.js">
	   </script>
       <script type="application/javascript" src="../inc/bootstrap.js">
	   </script>
       <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.js"></script>	
	<script type="text/javascript">
			$(function(){
				$('table').dataTable( {
					"bProcessing": true,
					"sAjaxSource": "../Api/Users.php",
					"aoColumns": [
						{ "mData": "FirstName" },
						{ "mData": "LastName" },
						{ "mData": "Name" }
					]
				} );

				
				
				
				
				$(".close").click(function(){
					$(this).closest(".alert").slideUp();
				});
				
				var settings = {
					backgroundColor: '#FF8888',
					color: '#FFFFFF'
				};
				<? if(isset($_GET['inserted'])): ?>
					$("html, body").animate({scrollTop: $(".info").offset().top}, 2000, 'easeInOutBack');
				<? endif; ?>
				$(".info td").css(settings).delay(2000).animate({backgroundColor: '#FFFFFF', color: '#000000'},2000);
				
				//	---------------------
				$(".delete-link").click(function(){
					$.get(this.href, function(data){
						$(".modal-body").html($(data).find("form"));
					})
					$(".modal").modal({ show: true });
					return false;
				});
			});
		</script>        
    </body>
</html>






